<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8" />
	<meta name="author" content="Liang wei">
    <meta name="viewport" content="width= device-width , user-scalable=no,initial-scale=1.0" />
	<link rel="stylesheet" href="css/header.css" />
	<!--<link rel="stylesheet" href="css/lunbo.css" />-->
	<!--<link rel="stylesheet"  href="css/base.css"/>-->
	<link rel="stylesheet" href="css/index.css" />
	<!--<script type="text/javascript" src="js/lunbo.js" ></script>-->
	<script type="text/javascript" src="js/jquery-3.1.1.js" ></script>
	<script type="text/javascript" src="js/vue.js" ></script>
	<!--<link rel="stylesheet" href="css/footer.css" />-->
	
	
	<style type="text/css">
	
	.logimn{
		/*border: 1px solid red;*/
	height: 550px;
	position:absolute;
	top:10%;
	left:4%;

    }
    
    .alert-close2 {
	/*background: url('../images/into.png') no-repeat 0px 3px;*/
	cursor: pointer;
	height: 100px;
	position: absolute;
	right: 12px;
	top: 253px;
	
    }
    
    form {
	padding: 0.5em 0.5em;
	}
    
	/*.footer {
	left: 22%;
	bottom: 59px;
	}*/
    /***********页尾开始***************/
.footer_box{ 
	margin-top: 239px;
	width:100%;
	height:140px;
  /*  background:#005e11;*/
    /* border: 1px solid red;*/
    overflow:hidden;
    }
.footer_box a{
	/*background: 1px solid red;*/
     background:#ffffff;
   
	/* display:block;   */      
     width:19%;
	 height:90px;
	 color:black;
     float:left;
	top: 20px;
	 
	 font-size:.80rem;
	 text-align:center;
	 }
.footer_box a:active{
	
/*	border: 1px solid red;*/
	 background:#013c0c;
	 }			   
.footer_box a img{
	/* background: 1px solid red;*/
	 display:block;
     width:100%;
	 margin:0 auto .05rem;
	}
/***********页尾结束***************/
    
    
    
    
</style>
	</head>
	<body>
		<div>			
		<div>
		<header>
				<img src="img/logo.png"  />
				<form class="search" action="">
					<input class="search_text" type="text" placeholder="搜索" />
				</form>
				<!--<a id="login" href="#">登录</a>-->
				<a id="signin" href="#">登陆</a>
		</header>
    	
    	
    	
  <div class="logimn">
    <div class="inset">
	<div class="login-head">
		<h1>注册</h1>
		<div class="alert-close"> </div> 			
	</div>
		<form>
			<li>
			    <input type="text" name="user" id="user" placeholder="请输入手机号"/>
			</li>
			
			<li>				 
			    <input type="password" name="user" id="user"  placeholder="请输入密码"/>
			</li>
			<li>				 
			    <input type="password" name="user" id="pwd"  placeholder="请再次输入密码"/>
			</li>
			
			
			<input  type="button" id="log2" value="注册" onclick="zhuce()">	
		</form>
		
		
		<script>
            function zhuce(){
            	 var user=$("#user").val();
		         var pwd=$("#pwd").val();
		    		 console.log(user);
		    		 console.log(pwd);
		    		   $.ajax({
             type: "POST",
             url: "http://172.24.10.175/workout/api.php/reg/tel/"+user+"/password/"+pwd,
             dataType: "jsonp",
　　　　　　　 success: function(result){
	         var leg=getHsonLength(result);
	         if(leg==1){
	         	alert('失败');
	         }
	         else
	         {
	         	alert('成功');
	         }
	         console.log(leg);
	         window.location.href='index.html';
                }
           });
            }
		    		
            
          function getHsonLength(result){
                var jsonLength=0;
                for (var i in result) {
                    jsonLength++;
                }
                return jsonLength;
           


	    </script>
    	
    	
    	
  
    	
   
     
         <!--<footer>-->
	
	<!--尾栏-->
	<div class="footer_box">
     <a href=""><img src="img/设备.png"/>联盟</a>
     <a href=""><img src="img/步数.png"/>训练</a>
     <a href=""><img src="img/活动.png"/>晒图</a>
     <a href=""><img src="img/运动.png"/>俱乐部</a>
     <a href=""><img src="img/首页.png"/>我的</a>
    </div>
	
	
	
	</footer>
	
	
	</body>
	

</html>
